<?php
/**
 * 频道免费使用（美容使用）
 * tryproductcontroller.php
 * 
 * Create on 2015-04-16 15:53:22
 * Create by yuebin
 */
namespace haibao\cms\business\control\pc\channel;

use haibao\cms\business\control\PublicController as PublicControllerBusiness;

class TryProductController extends ChannelController{
	
	public function __construct($updateTime = null,$controlId,$isPublish){
	    $this->savaLog();
		parent::__construct($updateTime,$controlId,$isPublish);
	}
	
	
	/**
	 * 获取模版内容
	 * @param : String $content
	 */
	public function displayTemplateHtml(){

		$controlData = $this->getParameter(self::$CONTROL_DATA);
		$content = $this->getParameter(self::$CONTROL_CONTENT);
		$path = $this->generateHtmlPath(__CLASS__);
		
		$limit = 3;
		if(isset($controlData['manual']['limit'])) $limit = $controlData['manual']['limit'];
		$tryProducts = PublicControllerBusiness::getTryProduct($limit);
		$this->assign('tryHost', \haibao\classlibrary\cms\Config::getConfig(\haibao\classlibrary\cms\Config::CLASSLIBRARY_CONFIG_HOST_TRY));
		$this->assign('tryProducts',$tryProducts);
		$this->generateHtml($path,$content);
		$content = $this->getHtml($path);

		$content = $this->replaceCDNLink($content);
		return $content;
	}
}